﻿<UserControl x:Class="MachineQA.View.LocationsView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:MachineQA.ViewModel"
             xmlns:views="clr-namespace:MachineQA.View"
             mc:Ignorable="d" 
             d:DesignHeight="1200" d:DesignWidth="1240" >
    <UserControl.Resources>
    </UserControl.Resources>
    <StackPanel Orientation="Vertical" HorizontalAlignment="Left" VerticalAlignment="Top" Width="1240" Height="1200">
        <ItemsControl Name="SelectedLocations"
        ItemsSource="{Binding Path=SelectedLocation}">
        </ItemsControl>
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top">
            <GroupBox Header="Locations" Width="300" Height="530">
                <StackPanel Orientation="Vertical">
                    <ListBox Name="LocationsList" 
                             Height="300" 
                             Width="290" 
                             DataContext="{Binding Path=AllLocations}"
                             SelectionMode="Single"
                             ItemsSource="{Binding}" SelectionChanged="LocationsList_SelectionChanged"
                             HorizontalAlignment="Right"
                             >
                    </ListBox>
                    <Label Name="NewLabel" Content="New item details:"/>
                    <StackPanel Orientation="Horizontal">
                        <StackPanel Orientation="Vertical">
                            <Label Name="MachineNameLabel" Content="Location name: " HorizontalAlignment="Right" Height="25"/>
                        </StackPanel>
                        <StackPanel Orientation="Vertical">
                            <TextBox Name="NewLocationNameBox" Width="200" TextChanged="NewLocationNameBox_TextChanged" DataContext="{Binding Path=NewLocation}" Text="{Binding Path=Name,Mode=TwoWay}" HorizontalAlignment="Center"/>
                        </StackPanel>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                    </StackPanel>
                    <StackPanel Orientation="Horizontal"></StackPanel>
                    <Button Name="LocationSaveButton" Content="Create Location" IsEnabled="false" Command="{Binding Path=SaveCommand}" Height="40"  Width="100" HorizontalAlignment="Right" HorizontalContentAlignment="Center" />
                </StackPanel>
            </GroupBox>
        </StackPanel>
    </StackPanel>
</UserControl>
